Redux, useSelector, useDispatch


用 hooks 取代 connect

connect => hooks
取資料: mapStateToProps => useSelector
更新資料: mapDispatchToProps => useDispatch

import { Provider, useSelector, useDispatch } from 'react-redux';
import { addTodo } from './action/todolist';







你可能感興趣的文章

Google Cloud Source Repositories 使用紀錄

Google Cloud Source Repositories 使用紀錄

[進階 js 03] == 和 === 的 special case

[進階 js 03] == 和 === 的 special case

W23_前端框架 Redux 學習筆記

W23_前端框架 Redux 學習筆記






留言討論